<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="common/header.jsp"%>

<div class="center">
			<div class="col-main">
				<div class="main-wrap" style="background-color:white ;">
					<div class="user-logistics">
						<!--标题 -->
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单详情</strong> / <small>Logistics&nbsp;History</small></div>
						</div>
						<hr/>
						<div class="package-title">
							<div class="m-item">
								<div class="item-pic">
									<img src="/pic/${bill.org_pic}" class="itempic J_ItemImg">
								</div>
								<div class="item-info">
									<p class="log-status">订单号:<span>${bill.b_id}</span> </p>
									<p>预定日期：<fmt:formatDate value="${bill.createDate}"/> </p>
									<p>支付方式：微信支付</p>
									<p>订单状态：
										<c:if test="${bill.status==1 && bill.isPay==1}">已成交</c:if>
										<c:if test="${bill.status==0 && bill.isPay==1}">待商家确认</c:if>
										<c:if test="${bill.isPay==0}">未支付</c:if>
									</p>
								</div>
							</div>
                         <div class="clear"></div>
						</div>
						<br>
						<div style="font-size:25px;color:red;margin-left:50px;">门票详细信息</div>
						<div class="package-status">
							<ul class="status-list">		
								<li class="latest">
									
									<div>${bill.p_Name}</div>
								</li>
								<hr/>
								<li>
									<span>门票简介: </span><span> ${bill.desc}</span>
								</li>
								<li>
									<span>使用日期: </span><span> <fmt:formatDate value="${bill.usingDate}"/> </span>
								</li>
								<li>
									<span>购买数量: </span><span> ${bill.count}张</span>
								</li>
								<li>
									<span>费用: </span><span> ${bill.price*bill.count}</span>
								</li>
								<li>
									<span>安全提示: </span>
									
										请务必保管好自身财务,假期景区游玩人众多
									
								</li>
								<li>
									<c:if test="${bill.isPay==0}">
										<a href="javascript:;" class="btn btn-danger pay">支付订单</a>
										<a href="javascript:;" class="btn btn-danger delete">删除订单</a>
									</c:if>
								</li>											
								
							</ul>
							<input name="proType" value="${bill.proType}" type="hidden" id="proType"/>
							<input name="b_id" value="${bill.b_id}" type="hidden" id="b_id"/>
						</div>
					</div>
				</div>
				</div>
<%@include file="common/footer.jsp"%>
</div>
	</body>
<script>
	var pay = $(".pay");
	var del = $(".delete");
	pay.on("click",function(){
		var b_id = $("#b_id").val();
		var proType = $("#proType").val();
		if(confirm("请确认支付,请保证信息的准确")){
			window.location.href = "/Trip/user/payment?proType="+proType+"&b_id="+b_id+"&isPay=1";
		}
	});
	
	del.on("click",function(){
		var bid = $("#b_id").val();
		if(confirm("是否删除订单？")){
			$.ajax({
			url : "/Trip/user/del",
			data : {b_id:bid},
			dataType : "json",
			type : "GET",
			success : function(data){
				alert("删除成功!!!");
				window.location.href = "/Trip/user/myinfo";
			},
			error : function(){
				alert("删除失败!!!");
				window.location.reload();
			}
			
		});
		}
		
		
		
		
	});
	
</script>
</html>